@extends('shared.master')

@section('content')
<div class="container-fluid">
    <div class="row">
        <div class="col-lg-12">
            <ol class="breadcrumb layout-title">
                                    <li><a href="{{url('usergroup')}}"><i class="fa fa-user fa-fw"></i> User Group</a></li>
                                    <li class="active" > Detail</li>
            </ol>
            {{PageData::Error()}}
            <div class="form-group">
                <label>Name</label>
                <p class="form-control-static">{{$Model->getName()}}</p>
            </div>
            <div class="form-group">
                <label>Is Enabled</label>
                <p class="form-control-static">{{$Model->getIsEnabled() ? "TRUE" : "FALSE" }}</p>
            </div>
            <div class="form-group">
                <label>Description</label>
                <p class="form-control-static">{{$Model->getDescription()}}</p>
            </div>
            <br>
            <div class="panel panel-default">
                <div class="panel-heading">
                  <h3 class="panel-title">Privilege Info</h3>
                </div>
            @if ($Model->getPrivilegeInfo() != null)
                <table class="table table-striped table-bordered table-hover" id="tbl_data_user">
                    <thead>
                        <tr>
                            <th>Functions</th>
                            <th>Module</th>
                            <th>Is Allow Access</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach ($Model->getPrivilegeInfo() as $item)
                            <tr class="odd gradeX" onclick="">
                            <td>{{$item->getFunctions()!=null ? $item->getFunctions()->getName() : "-"}}</td>
                            <td>{{$item->getModule()!=null ? $item->getModule()->getName() : "-"}}</td>
                            <td class="text-center">{{$item->getIsAllowAccess() ? "TRUE" : "FALSE" }}</td>
                        </tr>
                        @endforeach
                    </tbody>
                </table>
            @else
                <div class="panel-body">
                    No Detail Found!
                </div>
            @endif
            </div>
            </br>
            <p>
                <button onClick="location.href='{{ action('UserGroupController@edit', $Model->getId()) }}'" type="button" class="btn btn-primary">Edit</button>
                <button onClick="location.href='{{url('usergroup')}}'" type="button" class="btn btn-primary">Close</button>
            </p>
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <!-- /.row -->
</div>
<!-- /.container-fluid -->
    <script>
    
    </script>
@stop